<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box {
        width: 400px;
        height: 300px;
        background-color: aqua;
        display: none;
      }
    </style>
  </head>
  <body>
    <button>显示</button>
    <button>隐藏</button>
    <div class="box">box</div>
  </body>
  <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.4/jquery.js"></script>
  <script>
    //slideDown（）	向下滑动
    $("button")
      .eq(0)
      .click(function () {
        $(".box").slideDown();
        $(".box").slideDown(3000); //3000ms
        $(".box").slideDown("fast"); //200ms
        $(".box").slideDown("normal"); //400ms
        $(".box").slideDown("slow"); //600ms
      });
    //slideUp（）	向上滑动
    $("button")
      .eq(1)
      .click(function () {
        $(".box").slideUp();
        $(".box").slideUp(3000); //3000ms
        $(".box").slideUp("fast"); //200ms
        $(".box").slideUp("normal"); //200ms
        $(".box").slideUp("slow"); //200ms
      });
  </script>
</html>
